<template>
  <!-- <div>这是主页面</div> -->

  <!-- <div style="position: relative">
    <router-view v-slot="{ Component }">
      <transition name="fade">
        <component :is="Component" />
      </transition>
    </router-view>
  </div> -->

  <RouterView v-slot="{ Component }">
    <!-- include包含，exclude表示排除 -->
    <KeepAlive include="home,classify">
      <component :is="Component" />
    </KeepAlive>
  </RouterView>

  <TarBar />
</template>

<script>
import TarBar from "./components/TarBar.vue";
export default {
  components: {
    TarBar,
  },
};
</script>

<style scoped lang="less">
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>
